3.45 \(\int \frac{\cot ^2(x)}{\sqrt{a+b \cot ^2(x)}} \, dx\)

Optimal. Leaf size=64 \[ \frac{\tan ^{-1}\left (\frac{\sqrt{a-b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )}{\sqrt{a-b}}-\frac{\tanh ^{-1}\left (\frac{\sqrt{b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )}{\sqrt{b}} \]

[Out]

ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]/Sqrt[a - b] - ArcTanh[(Sqrt[b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]
/Sqrt[b]

________________________________________________________________________________________

Rubi [A]  time = 0.0903149, antiderivative size = 64, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.353, Rules used = {3670, 483, 217, 206, 377, 203} \[ \frac{\tan ^{-1}\left (\frac{\sqrt{a-b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )}{\sqrt{a-b}}-\frac{\tanh ^{-1}\left (\frac{\sqrt{b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )}{\sqrt{b}} \]

Antiderivative was successfully verified.

[In]

Int[Cot[x]^2/Sqrt[a + b*Cot[x]^2],x]

[Out]

ArcTan[(Sqrt[a - b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]/Sqrt[a - b] - ArcTanh[(Sqrt[b]*Cot[x])/Sqrt[a + b*Cot[x]^2]]
/Sqrt[b]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 483

Int[(((e_.)*(x_))^(m_)*((c_) + (d_.)*(x_)^(n_))^(q_.))/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Dist[e^n/b, Int[
(e*x)^(m - n)*(c + d*x^n)^q, x], x] - Dist[(a*e^n)/b, Int[((e*x)^(m - n)*(c + d*x^n)^q)/(a + b*x^n), x], x] /;
 FreeQ[{a, b, c, d, e, m, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LeQ[n, m, 2*n - 1] && IntBinomialQ[a, b
, c, d, e, m, n, -1, q, x]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 377

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\cot ^2(x)}{\sqrt{a+b \cot ^2(x)}} \, dx &=-\operatorname{Subst}\left (\int \frac{x^2}{\left (1+x^2\right ) \sqrt{a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\operatorname{Subst}\left (\int \frac{1}{\sqrt{a+b x^2}} \, dx,x,\cot (x)\right )+\operatorname{Subst}\left (\int \frac{1}{\left (1+x^2\right ) \sqrt{a+b x^2}} \, dx,x,\cot (x)\right )\\ &=-\operatorname{Subst}\left (\int \frac{1}{1-b x^2} \, dx,x,\frac{\cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )+\operatorname{Subst}\left (\int \frac{1}{1-(-a+b) x^2} \, dx,x,\frac{\cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )\\ &=\frac{\tan ^{-1}\left (\frac{\sqrt{a-b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )}{\sqrt{a-b}}-\frac{\tanh ^{-1}\left (\frac{\sqrt{b} \cot (x)}{\sqrt{a+b \cot ^2(x)}}\right )}{\sqrt{b}}\\ \end{align*}

Mathematica [B]  time = 0.267719, size = 158, normalized size = 2.47 \[ \frac{\sin (x) \sqrt{\csc ^2(x) ((b-a) \cos (2 x)+a+b)} \left (\sqrt{a-b} \tanh ^{-1}\left (\frac{\sqrt{2} \sqrt{-b} \cos (x)}{\sqrt{(a-b) \cos (2 x)-a-b}}\right )-\sqrt{-b} \tanh ^{-1}\left (\frac{\sqrt{2} \sqrt{a-b} \cos (x)}{\sqrt{(a-b) \cos (2 x)-a-b}}\right )\right )}{\sqrt{-b} \sqrt{a-b} \sqrt{(a-b) \cos (2 x)-a-b}} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[x]^2/Sqrt[a + b*Cot[x]^2],x]

[Out]

((-(Sqrt[-b]*ArcTanh[(Sqrt[2]*Sqrt[a - b]*Cos[x])/Sqrt[-a - b + (a - b)*Cos[2*x]]]) + Sqrt[a - b]*ArcTanh[(Sqr
t[2]*Sqrt[-b]*Cos[x])/Sqrt[-a - b + (a - b)*Cos[2*x]]])*Sqrt[(a + b + (-a + b)*Cos[2*x])*Csc[x]^2]*Sin[x])/(Sq
rt[a - b]*Sqrt[-b]*Sqrt[-a - b + (a - b)*Cos[2*x]])

________________________________________________________________________________________

Maple [A]  time = 0.028, size = 80, normalized size = 1.3 \begin{align*} -{\ln \left ( \cot \left ( x \right ) \sqrt{b}+\sqrt{a+b \left ( \cot \left ( x \right ) \right ) ^{2}} \right ){\frac{1}{\sqrt{b}}}}+{\frac{1}{ \left ( a-b \right ){b}^{2}}\sqrt{{b}^{4} \left ( a-b \right ) }\arctan \left ({ \left ( a-b \right ){b}^{2}\cot \left ( x \right ){\frac{1}{\sqrt{{b}^{4} \left ( a-b \right ) }}}{\frac{1}{\sqrt{a+b \left ( \cot \left ( x \right ) \right ) ^{2}}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(x)^2/(a+b*cot(x)^2)^(1/2),x)

[Out]

-ln(cot(x)*b^(1/2)+(a+b*cot(x)^2)^(1/2))/b^(1/2)+(b^4*(a-b))^(1/2)/b^2/(a-b)*arctan(b^2*(a-b)/(b^4*(a-b))^(1/2
)/(a+b*cot(x)^2)^(1/2)*cot(x))

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cot \left (x\right )^{2}}{\sqrt{b \cot \left (x\right )^{2} + a}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2/(a+b*cot(x)^2)^(1/2),x, algorithm="maxima")

[Out]

integrate(cot(x)^2/sqrt(b*cot(x)^2 + a), x)

________________________________________________________________________________________

Fricas [B]  time = 2.09716, size = 1413, normalized size = 22.08 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2/(a+b*cot(x)^2)^(1/2),x, algorithm="fricas")

[Out]

[-1/2*(sqrt(-a + b)*b*log(-(a - b)*cos(2*x) + sqrt(-a + b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin
(2*x) + b) - (a - b)*sqrt(b)*log(((a - 2*b)*cos(2*x) + 2*sqrt(b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1
))*sin(2*x) - a - 2*b)/(cos(2*x) - 1)))/(a*b - b^2), 1/2*(2*(a - b)*sqrt(-b)*arctan(sqrt(-b)*sqrt(((a - b)*cos
(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x)/(b*cos(2*x) + b)) - sqrt(-a + b)*b*log(-(a - b)*cos(2*x) + sqrt(-a + b
)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x) + b))/(a*b - b^2), 1/2*(2*sqrt(a - b)*b*arctan(-sqr
t(a - b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x)/((a - b)*cos(2*x) + a - b)) + (a - b)*sqrt(b
)*log(((a - 2*b)*cos(2*x) + 2*sqrt(b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*sin(2*x) - a - 2*b)/(cos
(2*x) - 1)))/(a*b - b^2), (sqrt(a - b)*b*arctan(-sqrt(a - b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*x) - 1))*s
in(2*x)/((a - b)*cos(2*x) + a - b)) + (a - b)*sqrt(-b)*arctan(sqrt(-b)*sqrt(((a - b)*cos(2*x) - a - b)/(cos(2*
x) - 1))*sin(2*x)/(b*cos(2*x) + b)))/(a*b - b^2)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cot ^{2}{\left (x \right )}}{\sqrt{a + b \cot ^{2}{\left (x \right )}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)**2/(a+b*cot(x)**2)**(1/2),x)

[Out]

Integral(cot(x)**2/sqrt(a + b*cot(x)**2), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cot \left (x\right )^{2}}{\sqrt{b \cot \left (x\right )^{2} + a}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(x)^2/(a+b*cot(x)^2)^(1/2),x, algorithm="giac")

[Out]

integrate(cot(x)^2/sqrt(b*cot(x)^2 + a), x)